﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="companySupplyRange.aspx.cs"
    Inherits="PeisongWeb.admin.companySupplyRange" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>商品供应范围 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script src="/app_common/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        function resetSrh() {
            document.getElementById("txt_ProductNo").value = "";
            document.getElementById("txt_Name").value = "";
            //            document.getElementById("txt_CompanyName").value = "";
            //            document.getElementById("txt_Rate").value = "";
            document.getElementById("chx_isCancel").checked = false;
            $('#ddlProductBus').val('');
        }
        $(function() {
            $('#chkSelectedAll').click(function() {
                if ($(this).attr('checked')) {
                    $(':checkbox', $('#admin_list_content')).attr('checked', true);
                } else {
                    $(':checkbox', $('#admin_list_content')).attr('checked', null);
                }
            });

            $(':checkbox').click(function() {
                if ($(this).attr('id') != 'chkSelectedAll') {
                    if ($(this).attr('checked')) {
                        $(this).parent().parent().find('td').addClass('checkRow_alt');
                    } else {
                        $(this).parent().parent().find('td').removeClass('checkRow_alt');
                    }
                }
            });
        });

        function delSelectedConfirm(obj) {
            var k = [];
            $(':checkbox', $('#admin_list_content')).each(function(entryIndex, entry) {
                if ($(entry).attr('checked')) {
                    k.push($(entry).attr('srId'));
                }
            });
            if (k != 0) {
                $('#hdSelectedSrIds').val(k.join(','));
                return confirm('你确定要删除这' + (k.length) + '项吗?');
            } else {
                alert('无任何可以删除的项.');
                return false;
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            <span runat="server" id="span_Company"></span>商品供应范围
        </h2>
        <span>
            <ext:Button runat="server" ID="btn_Add" Icon="Add" Text="增加范围">
            </ext:Button>
            &nbsp;&nbsp;
            <ext:Button runat="server" ID="btn_Init_Click" AutoPostBack="true" OnClientClick="return confirm('你确定要执行此操作吗?');"
                OnClick="btn_zation_Click" Text="一健初始化供应范围" Icon="Add">
            </ext:Button>
        </span>
        <p>&nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="商品供应范围搜索" BodyStyle="padding:5px 5px 0"
            Width="1120" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li style="width:190px;margin-right:5px;">
                            <label style="width:50px">
                                商品编号
                            </label>
                            <input id="txt_ProductNo" style="width:125px;" runat="server" type="text" />
                        </li>
                        <li style="width:190px;margin-right:5px;">
                            <label style="width:50px">
                                商品名称
                            </label>
                            <input id="txt_Name" style="width:125px;" runat="server" type="text" />
                        </li>
                        <li style="width:150px;margin-right:5px;">
                            <label style="width:50px">
                                商品等级
                            </label>
                            <asp:DropDownList runat="server" ID="ddlProductBus" DataTextField="name" DataValueField="xm">
                            </asp:DropDownList>
                        </li>
                        <li style="width: 180px;margin-right:5px;">
                            <label style="width:50px;text-align: right;">
                                取消供应
                            </label>
                            <input id="chx_isCancel" type="checkbox" runat="server" />是 </li>
                        <li style="width:auto;">
                            <label>&nbsp;</label>
                            <asp:LinkButton ID="lbtn_Search" runat="server" Text="[搜 索]" OnClick="lbtn_Search_Click">
                            </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">[重 置]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:LinkButton runat="server" ID="link_Export_SellerRange" Text="[导出Excel]" OnClick="link_Export_SellerRange_Click"></asp:LinkButton>
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content" style="width: 1120px;">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        <input type="checkbox" id="chkSelectedAll" />
                    </th>
                    <th>
                        商品编号
                    </th>
                    <th>
                        商品等级
                    </th>
                    <th>
                        商品名称
                    </th>
                    <th>
                        是否供应中
                    </th>
                    <th style="<%=power>=2?"": "display:none" %>">
                        操 作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <input type="checkbox" srId='<%# DataBinder.Eval(Container.DataItem,"srId") %>' />
                            </td>
                            <td>
                                <%# Eval("productNo")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem,"businessNatureName") %>
                            </td>
                            <td>
                                <%# Eval("productName")%>
                            </td>
                            <td>
                                <%# Convert.ToBoolean(Eval("isCancel"))?"否":"是"%>
                            </td>
                            <td style="<%=power>=2?"": "display:none" %>">
                                <asp:LinkButton ID="lbt_delete" runat="server" CommandName="Del" CommandArgument='<%# Eval("srId") %>' Text="删除" OnClientClick="javascript:return confirm('你确定执行此操作吗?')">
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbt_goOn" runat="server" CommandName="GO" CommandArgument='<%# Eval("srId") %>' ForeColor="Red" Text="继续供应" OnClientClick="javascript:return confirm('你确定让此供应商继续供应该商品吗?')" Visible='<%# Convert.ToBoolean(Eval("isCancel"))?true:false%>'>
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtn_Cancel" runat="server" CommandName="CancelRange" CommandArgument='<%# Eval("srId") %>' Text="取消供应" OnClientClick="javascript:return confirm('你确定执行此操作吗?')" Visible='<%# Convert.ToBoolean(Eval("isCancel"))?false:true%>'>
                                </asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr>
                    <td colspan="7">
                        <asp:Button runat="server" ID="btnDelSelected" Text="删除选择项" OnClientClick="return delSelectedConfirm(this);" OnClick="btnDelSelected_Click" />
                    </td>
                </tr>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <asp:HiddenField runat="server" ID="hdSelectedSrIds" />
    </form>
</body>
</html>
